import { createSlice, createAsyncThunk } from '@reduxjs/toolkit';
import { idget } from '../../services/admin';

const adminSlice = createSlice({
    name: "admin",
    initialState: {
        isModalVisible: false,
        admins: {},
        student: [],
        adminId: ""
    },
    reducers: {
        isModalVisible(state, action) {
            state.isModalVisible = action.payload;
        },
        setAdmin(state, action) {
            state.admins = action.payload;
        },
        setAdminId(state, action) {
            state.adminId = action.payload;
        },
        setStudent(state, action) {
            state.student = action.payload
        }
    }
});

export const { isModalVisible, setAdmin, setAdminId, setStudent } = adminSlice.actions;
export default adminSlice.reducer;